$(document).ready(function () {
    // Enable/disable collapse menu
    $('.navbar-minimalize1').click(function () {
        if ($('#collapsemenu').is(':checked')) {
            $("body").addClass('mini-navbar');
            SmoothlyMenu();
            if (localStorageSupport) {
                localStorage.setItem("collapse_menu",'on');
            }
        } else {
            $("body").removeClass('mini-navbar');
            SmoothlyMenu();
            if (localStorageSupport) {
                localStorage.setItem("collapse_menu",'off');
            }
        }
    });

    /*var url = '/admin/role/';
    $('body').on('click', 'button.delete', function () {
        var role_id = $(this).val();
        $.ajax({
            type: 'post',
            url: url + role_id,
            data: {_method: 'delete',_token:$(this).attr('data-token')},
            success: function (data) {
                //alert(JSON.stringify(data));
                console.log(data);
                $('#role' + role_id).remove();
                toastr.success('删除成功！');
            },
            error: function (data, json, errorThrown) {
                console.log(data);
                var errors = data.responseJSON;
                 var errorsHtml= '';
                 $.each( errors, function( key, value ) {
                 errorsHtml += '<li>' + value[0] + '</li>';
                 });
                 toastr.error( errorsHtml , "Error " + data.status +': '+ errorThrown);
            }
        });
    });*/

});